<!-- 添加数据字典子项 -->
<title>添加</title>
<link rel="stylesheet"
	href="/datetimepicker/css/bootstrap-datetimepicker.min.css" />
<!-- /section:settings.box -->
<div class="row">
	<div class="col-xs-12 registerform js_dict_chid_editor ">
		<div class="row">
			<div class="col-xs-12">
				<!-- 要修改的地方，from标签 action属性 -->
				<div class="space-4"></div>
				<div class="form-group">
					<label for="form-field-content-type"
						class="col-sm-2 control-label no-padding-right">分类名称：</label>
					<div class="input-group col-sm-10">
						<div class="in_txt">
								<?=$model['sys_value']?>
							</div>
						<div class="tishi">
							<div class="Validform_checktip"></div>
						</div>
					</div>
				</div>
				<!-- 输入div开始 -->
				<!-- 要修改的 input标签name和id属性，label表情文字信息-->
				<div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label no-padding-right"
						for="form-field-name">分类名称：</label>
					<div class="input-group col-sm-10">
						<div class="in_txt">
							<input type="text" name="hx_name" id="hx_name"
								value="<?=$d_model['sys_value']?>" class="input-large inputxt"
								datatype="*" placeholder="分类名称">
						</div>
						<div class="tishi">
							<div class="Validform_checktip"></div>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label no-padding-right"
						for="form-field-name">排序：</label>
					<div class="input-group col-sm-10">
						<div class="in_txt">
							<input type="text" name="hx_ordernum"
								value="<?=$d_model['sys_order_num']?>" id="hx_ordernum"
								class="input-large inputxt" datatype="n" placeholder="排序">
						</div>
						<div class="tishi">
							<div class="Validform_checktip"></div>
						</div>
					</div>
				</div>
				<!-- 输入div结束 -->
				<div class="space-4"></div>
				<div class="clearfix form-actions">
					<div class="col-md-offset-3 col-md-9">
						<button class="btn btn-info save" type="button" id="btnSubmit">
							<i class="ace-icon fa fa-check bigger-110"></i>保存
						</button>
						&nbsp; &nbsp;
						<button class="btn" type="reset">
							<i class="ace-icon fa fa-undo bigger-110 reset"></i>还原
						</button>
					</div>
				</div>
				<input type="hidden" id="dt_pk" value="<?=$model['id']?>" /> <input
					type="hidden" id="d_id" value="<?=$d_model['id']?>" />
			</div>
			<!-- PAGE CONTENT ENDS -->
			<script type="text/javascript">
		var scripts = [null,null];
		$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
			var $scope = $(".js_dict_chid_editor");
			//表单验证
			var vform= $(".registerform").Validform({
				tiptype:2
			});
			$("#btnSubmit",$scope).click(function(){
				if(!vform.check(false))
				{
					return;	
				}				
			 var parent_id=	$("#dt_pk",$scope).val();
			 var name=$("#hx_name",$scope).val();
			 var ordernum=$("#hx_ordernum",$scope).val(); 
			 var id = $("#d_id",$scope).val(); 
			 $.post('/sys/ajax_dict_editor',{
				 	'id':id,
				 	'dt_pk':parent_id,
					'dt_value':name,
					'sys_order_number':ordernum
				},function(data){
					if(200===data.status)
					{
						message_box.show(data.data);
						gDialog.fClose();
						if ( typeof(pageObj) != "undefined" ) {		
							if(data.page<pageObj.get_page_count()){
								pageObj.dec_page_count();//-1
								if(pageObj.get_page_index() > pageObj.get_page_count()){
									pageObj.go_page(pageObj.get_page_count());
								}else{
									pageObj.cur_page();
								}
							  }else{
								pageObj.cur_page();
							  }		
						 }		
					}else
					{
					  message_box.show(data.data);
					}
					 
			},'json');
			});
		})
		</script>
		</div>
	</div>
</div>